package com.qidian.mes.device.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.device.service.ReservoirService;
import com.qidian.mes.pojo.Reservoir;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 刘泽磊
 * @Company 起点编程
 * @Description
 * @Time 2024/10/26 14:48
 */
@RestController
@RequestMapping("/reservoir")
@CrossOrigin
public class ReservoirController {
    @Autowired
    private ReservoirService reservoirService;
    @GetMapping("/list")
    public MESResult select(Reservoir reservoir){
        return reservoirService.select(reservoir);
    }
    @PostMapping("/insert")
    public MESResult insert(@RequestBody Reservoir reservoir){
        return reservoirService.insert(reservoir);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody Reservoir reservoir){
        return reservoirService.update(reservoir);
    }
    @GetMapping("/selectById")
    public MESResult selectById(Long reservoirId){
        return reservoirService.selectById(reservoirId);
    }
    @DeleteMapping("/delete")
    public MESResult delete(Long reservoirId){
        return reservoirService.delete(reservoirId);
    }
}
